package com.studyadmin.util;

import java.util.HashSet;
import java.util.Set;

/**
 * @author lyl
 * Date:2023/4/16
 *
 * 自定义字符过滤包
 */
public class SensitiveWordsUtil {
    public static String textFiltering(String text){
        Set<String> sensitiveWords=new HashSet<>();
        sensitiveWords.add("shit");
        sensitiveWords.add("傻逼");
        sensitiveWords.add("笨蛋");
        sensitiveWords.add("fuck");
        sensitiveWords.add("菜狗");
        sensitiveWords.add("屌丝");
        sensitiveWords.add("泰裤辣");
        sensitiveWords.add("油腻");
        sensitiveWords.add("嗨还");
        sensitiveWords.add("ohh");
        String listString = "";
        for(String sensitiveWord:sensitiveWords){
            if(text.contains(sensitiveWord)){
                listString += sensitiveWord+ " ";
            }
        }
        return listString;

    }

}
